<template>
  <h1>父组件</h1>
  <h1>{{ todos }}</h1>
  <button @click="todos.push(Math.random() * 20 | 0)">点击添加</button>

  <hr>
  <sub-com :todos="todos" @clear="todos = []"></sub-com>
</template>
<script setup>
import subCom from './components/sub-com.vue';
import { ref } from 'vue'
let todos = ref([1, 2, 3, 4, 5])

</script>
<script>
export default {
  name: "App",
};
</script>

<style></style>